package com.lin.spring.service.impl;

import com.lin.spring.dao.UserMapper;
import com.lin.spring.entity.User;
import com.lin.spring.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName UserServiceImpl
 * @Description userServiceImpl
 * @Author lin
 * @Date 2021/11/17 下午10:54
 * @Version V1.0
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public void insertUser(User user) {
        // int i=4/0;
        userMapper.insertUser(user);
    }

    @Override
    public User findUserById(int id) {
        User userById = userMapper.findUserById(id);
        return userById;
    }
}
